{template 'public/header-base'}
{if !defined('IS_OPERATOR')}
<section id="container" class="">   
      <header class="header white-bg">
            <div class="sidebar-toggle-box">
				<img class="avatar" width="29" height="29" src="{if $logo['logo']}{php echo tomedia($logo['logo'])}{else}{php echo tomedia('headimg_'.$_W['account']['acid'].'.jpg')}?time={php echo time()}{/if}" onerror="this.src='resource/images/gw-wx.gif'" alt="{$logo['title']}">
            </div>
            <!--logo start-->
            <a class="logo"><span>{$logo['title']}</span></a>
            <!--logo end-->            
            <div class="top-nav ">
                <!--user info start-->
                <ul class="nav pull-right top-menu">      
                    <!-- user login dropdown start-->
                    <li class="dropdown">
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
							<i class="fa fa-user"></i>
                            <span class="username">
								{$_W['user']['username']} ({if $_W['isfounder']}系统管理员{elseif $_W['role'] == 'owner'}公众号管理员{else}{$mysf['tname']}{/if})
							</span>
                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu extended logout">
                            <div class="log-arrow-up"></div>
                            {if $_W['isfounder'] || $_W['role'] == 'owner'}
							<li><a href="{url 'home/welcome/platform'}" target="_blank"><i class="fa fa-share"></i>其他功能</a></li>
							<li><a href="{url 'user/profile/profile'}"><i class="fa fa-suitcase"></i>我的账号</a></li>
                            <li><a href="{url 'system/welcome'}"><i class="fa fa-cog"></i> 系统选项</a></li>
                            <li><a href="{url 'system/welcome'}"><i class="fa fa-cog"></i> 自动更新</a></li>
                            <li><a href="{url 'system/updatecache'}"><i class="fa fa-refresh"></i> 更新缓存</a></li>
							<li><a href="{url 'user/logout'}"><i class="fa fa-key"></i> 退出系统</a></li>
                            {else}
                            <li><a href="{$_W['siteroot']}addons/fm_jiaoyu/admin"><i class="fa fa-key"></i> 退出系统</a></li>
							{/if}
                        </ul>
                    </li>
                    <!-- user login dropdown end -->
                </ul>
                <!--user info end-->
            </div>
			{if $_W['isfounder'] || $_W['role'] == 'manager' || $_W['role'] == 'owner'}
                <!--  notification start -->
				<div class="top-nav ">
					<!--user info start-->
					<ul class="nav pull-right top-menu">      
						<!-- user login dropdown start-->
						<li class="dropdown">
							<a data-toggle="dropdown" class="dropdown-toggle" href="#">
								<img class="avatar" width="29" height="29" src="{if $logo['logo']}{php echo tomedia($logo['logo'])}{else}{php echo tomedia('headimg_'.$_W['account']['acid'].'.jpg')}?time={php echo time()}{/if}" onerror="this.src='resource/images/gw-wx.gif'" alt="{$logo['title']}">
								<span class="username">{$logo['title']}</span>
								<b class="caret"></b>
							</a>
							<ul class="dropdown-menu extended tasks-bar">
								<div class="notify-arrow notify-arrow-green" style="right: 7px;"></div>
								{loop $schoollist $row}
									<li {if $row['id'] == $_GPC['schoolid']}style="background-color:#a9d86e;"{/if}>
										<a href="{$_W['siteroot']}web/index.php?c=site&a=entry&do=start&id={$row['id']}&schoolid={$row['id']}&m=fm_jiaoyu">
										<img class="avatar" width="29" height="29" src="{if $row['logo']}{php echo tomedia($row['logo'])}{else}{php echo tomedia('headimg_'.$_W['account']['acid'].'.jpg')}?time={php echo time()}{/if}" onerror="this.src='resource/images/gw-wx.gif'" alt="{$logo['title']}">
										&nbsp;&nbsp;&nbsp;{$row['title']}
										</a>
									</li>
								{/loop}
							</ul>
						</li>
						<!-- user login dropdown end -->
					</ul>
					<!--user info end-->
				</div>				
				{else}
				<div class="top-nav ">
					<!--user info start-->
					<ul class="nav pull-right top-menu">      
						<!-- user login dropdown start-->
						<li class="dropdown">
							<a data-toggle="dropdown" class="dropdown-toggle" href="#">
								<img class="avatar" width="29" height="29" src="{if $logo['logo']}{php echo tomedia($logo['logo'])}{else}{php echo tomedia('headimg_'.$_W['account']['acid'].'.jpg')}?time={php echo time()}{/if}" onerror="this.src='resource/images/gw-wx.gif'" alt="{$logo['title']}">
								<span class="username">{$logo['title']}</span>
								<b class="caret"></b>
							</a>
							<ul class="dropdown-menu extended tasks-bar">
								<div class="notify-arrow notify-arrow-green" style="right: 7px;"></div>
								{loop $schoollist $row}
									<li {if $row['id'] == $_GPC['schoolid']}style="background-color:#a9d86e;"{/if}>
										<a href="{$_W['siteroot']}web/index.php?c=site&a=entry&do=start&id={$row['id']}&schoolid={$row['id']}&m=fm_jiaoyu"><i class="fa fa-weixin"></i>
										&nbsp;&nbsp;&nbsp;{$row['title']}
										</a>
									</li>
								{/loop}
							</ul>
						</li>
						<!-- user login dropdown end -->
					</ul>
					<!--user info end-->
				</div>
				{/if}
                <!--  notification end -->
            </div>       
        </header>
		<div class="navbar navbar-inverse navbar-static-top" role="navigation" style="position:static;">

		</div>
		
		{if empty($_COOKIE['check_setmeal']) && !empty($_W['account']['endtime']) && ($_W['account']['endtime'] - TIMESTAMP < (6*86400))}
			<div class="upgrade-tips" id="setmeal-tips">
				<a href="{php echo url('user/edit', array('uid' => $_W['account']['uid']));}" target="_blank">
					您的服务有效期限：{php echo date('Y-m-d', $_W['account']['starttime']);} ~ {php echo date('Y-m-d', $_W['account']['endtime']);}.
					{if $_W['account']['endtime'] < TIMESTAMP}
					目前已到期，请联系管理员续费
					{else}
					将在{php echo ($_W['account']['endtime'] - strtotime(date('Y-m-d')))/86400}天后到期，请及时付费
					{/if}
				</a><span class="tips-close" style="background:#d03e14;" onclick="check_setmeal_hide();"><i class="fa fa-times-circle"></i></span>
			</div>
			<script>
				function check_setmeal_hide() {
					util.cookie.set('check_setmeal', 1, 1800);
					$('#setmeal-tips').hide();
					return false;
				}
			</script>
		{/if}
	{/if}
	<div class="container-fluid">
		{if defined('IN_MESSAGE')}
		<div class="jumbotron clearfix alert alert-{$label}">
			<div class="row">
				<div class="col-xs-12 col-sm-3 col-lg-2">
					<i class="fa fa-5x fa-{if $label=='success'}check-circle{/if}{if $label=='danger'}times-circle{/if}{if $label=='info'}info-circle{/if}{if $label=='warning'}exclamation-triangle{/if}"></i>
				</div>
				<div class="col-xs-12 col-sm-8 col-md-9 col-lg-10">
					{if is_array($msg)}
						<h2>MYSQL 错误：</h2>
						<p>{php echo cutstr($msg['sql'], 300, 1);}</p>
						<p><b>{$msg['error'][0]} {$msg['error'][1]}：</b>{$msg['error'][2]}</p>
					{else}
					<h2>{$caption}</h2>
					<p>{$msg}</p>
					{/if}
					{if $redirect}
					<p><a href="{$redirect}">如果你的浏览器没有自动跳转，请点击此链接</a></p>
					<script type="text/javascript">
						setTimeout(function () {
							location.href = "{$redirect}";
						}, 3000);
					</script>
					{else}
						<p>[<a href="javascript:history.go(-1);">点击这里返回上一页</a>] &nbsp; [<a href="./?refresh">首页</a>]</p>
					{/if}
				</div>
		{else}
		<div class="row">
			{if !defined('IS_OPERATOR')}
				{php $frames = empty($frames) ? $GLOBALS['frames'] : $frames; _calc_current_frames($frames);}
			{else}
				{php $frames = empty($frames) ? $GLOBALS['frames'] : $frames; mine_current_frames($frames);}
			{/if}
			{if !empty($frames)}
				<div class="col-xs-12 col-sm-3 col-lg-2 big-menu"  style="margin-left:10px;margin-bottom:100px;position: fixed;height: 100%;background-color: #233646;">
					<div class="panel panel-default" style="background-color: #233646;">
						<span style="width:13.3333337%; height:100px;display: table-cell; line-height:100px;background-color: #233646; vertical-align:middle;text-align: center;">
							<img style="width:100px;height: 100px;margin-top:10px;border-radius:50%;" alt="image" class="img-circle" src="{if $mysf['thumb']}{php echo tomedia($mysf['thumb'])}{else}{php echo tomedia($logo['logo'])}{/if}" />
						</span>
						<span style="text-align:center;" class="block m-t-xs"><strong class="font-bold" style="color:green;">{$logo['title']}</strong></span>
						<span style="text-align:center;margin-bottom:10px;" class="text-muted text-xs block">
							<strong class="font-bold">{if $mysf['tname']}{$mysf['tname']}{else}{$_W['user']['username']}{/if}</strong><br>
							({if $_W['role'] == 'founder'}系统管理员{elseif $_W['role'] == 'owner'}公众号管理员{else}{if $myfz['sname']}{$myfz['sname']}{else}{$logo['title']}{/if}{/if})
						</span>	
					</div>
					<style>
					.list-group-item active{background-color:#233646;border-color: #233646;}
					.list-group-item{cursor:pointer; overflow:hidden;background-color: #2f4050;color:#a1a1a1;box-sizing: border-box;}
					.list-group-item:hover {cursor:pointer; overflow:hidden;background-color: #3a4e61;color:#fff;box-sizing: border-box;}
					#biaoti{cursor:pointer;background-color:#2f4050;}
					#biaoti:hover {cursor:pointer;background-color:#3a4e61;}		
					</style>
					{loop $frames $k $frame}
					<div class="panel panel-default">
						<div class="panel-heading" id="biaoti"  data-toggle="collapse" {if $link['active']}aria-expanded="false"{/if} href="#frame-{$k}">
							<h4 class="panel-title" style="color:#f3eeee">{$frame['title']}</h4>
							<a class="panel-collapse collapsed" style="cursor:pointer;background-color: #2f4050;">
								<i class="fa fa-chevron-circle-down"></i>
							</a>
						</div>
						<ul {if $frame['this'] == $this1}class="list-group collapse in"{else}class="list-group collapse"{/if} id="frame-{$k}" {if $link['active']}aria-expanded="false" style="height: 0px;background-color: #2f4050;"{/if}>
							{loop $frame['items'] $link}
							{if !empty($link['append'])}
							<li class="list-group-item{$link['active']}" onclick="window.location.href = '{$link['url']}';" kw="{$link['title']}">
								<a class="pull-right" style="color:#a1a1a1" href="{$link['append']['url']}">{$link['append']['title']}</a>
								{$link['title']}
							</li>
							{else}
							<a class="list-group-item{$link['active']}" style="color:#a1a1a1" href="{$link['url']}" kw="{$link['title']}">{$link['title']}</a>
							{/if}
							{/loop}
						</ul>
					</div>
					{/loop}
					<script type="text/javascript">
						require(['bootstrap'], function(){
							$('.ext-type').click(function(){
								var id = $(this).data('id');
								util.cookie.del('ext_type');
								util.cookie.set('ext_type', id, 8640000);
								location.reload();
								return false;
							});

							$('#search-menu input').keyup(function() {
								var a = $(this).val();
								$('.big-menu .list-group-item, .big-menu .panel-heading').hide();
								$('.big-menu .list-group-item').each(function() {
									$(this).css('border-left', '0');
									if(a.length > 0 && $(this).attr('kw').indexOf(a) >= 0) {
										$(this).parents(".panel").find('.panel-heading').show();
										$(this).show().css('border-left', '3px #428bca double');
									}
								});
								if(a.length == 0) {
									$('.big-menu .list-group-item, .big-menu .panel-heading').show();
								}
							});
						});
					</script>
				</div>
				<div class="col-xs-12 col-sm-9 col-lg-10">
					{if !defined('IS_OPERATOR')}
						{if CRUMBS_NAV == 2}
							{php global $module_types;global $module;global $ptr_title; global $site_urls; $m = $_GPC['m'];}
							<ul class="nav nav-tabs">
								<li><a href="{url 'platform/reply' array('m' => $m)}">管理{$module['title']}</a></li>
								<li><a href="{url 'platform/reply/post' array('m' => $m)}"><i class="fa fa-plus"></i> 添加{$module['title']}</a></li>
								{if !empty($site_urls)}
									{loop $site_urls $site_url}
										<li {if $_GPC['do'] == $site_url['do']} class="active"{/if}><a href="{$site_url['url']}"> {$site_url['title']}</a></li>
									{/loop}
								{/if}
							</ul>
						{/if}
					{/if}
			{else}
				<div class="col-xs-12 col-sm-12 col-lg-12">
			{/if}
		{/if}
		